<?php
/**
 * SDTargetingRecommendationsRequestV33
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API for Sponsored Display
 *
 * This API enables programmatic access for campaign creation, management, and reporting for Sponsored Display campaigns. For more information on the functionality, see the [Sponsored Display Support Center](https://advertising.amazon.com/help#GTPPHE6RAWC2C4LZ). For API onboarding information, see the [account setup](https://advertising.amazon.com/API/docs/en-us/guides/onboarding/overview) topic.<br/><br/> > This specification is available for download from the **[Advertising API developer portal](https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/sponsored-display/3-0/openapi.yaml).**
 *
 * OpenAPI spec version: 3.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * SDTargetingRecommendationsRequestV33 Class Doc Comment
 *
 * @category Class
 * @description Request for targeting recommendations for API version 3.3.
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class SDTargetingRecommendationsRequestV33 implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'SDTargetingRecommendationsRequestV33';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'tactic' => '\AmazonAdvertisingApi\Model\SDTacticV31',
        'products' => '\AmazonAdvertisingApi\Model\SDTargetingRecommendationsProducts',
        'type_filter' => '\AmazonAdvertisingApi\Model\SDTargetingRecommendationsTypeFilterV32',
        'themes' => '\AmazonAdvertisingApi\Model\SDTargetingRecommendationsThemes'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'tactic' => null,
        'products' => null,
        'type_filter' => null,
        'themes' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'tactic' => 'tactic',
        'products' => 'products',
        'type_filter' => 'typeFilter',
        'themes' => 'themes'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'tactic' => 'setTactic',
        'products' => 'setProducts',
        'type_filter' => 'setTypeFilter',
        'themes' => 'setThemes'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'tactic' => 'getTactic',
        'products' => 'getProducts',
        'type_filter' => 'getTypeFilter',
        'themes' => 'getThemes'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['tactic'] = isset($data['tactic']) ? $data['tactic'] : null;
        $this->container['products'] = isset($data['products']) ? $data['products'] : null;
        $this->container['type_filter'] = isset($data['type_filter']) ? $data['type_filter'] : null;
        $this->container['themes'] = isset($data['themes']) ? $data['themes'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['tactic'] === null) {
            $invalidProperties[] = "'tactic' can't be null";
        }
        if ($this->container['products'] === null) {
            $invalidProperties[] = "'products' can't be null";
        }
        if ($this->container['type_filter'] === null) {
            $invalidProperties[] = "'type_filter' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets tactic
     *
     * @return \AmazonAdvertisingApi\Model\SDTacticV31
     */
    public function getTactic()
    {
        return $this->container['tactic'];
    }

    /**
     * Sets tactic
     *
     * @param \AmazonAdvertisingApi\Model\SDTacticV31 $tactic tactic
     *
     * @return $this
     */
    public function setTactic($tactic)
    {
        $this->container['tactic'] = $tactic;

        return $this;
    }

    /**
     * Gets products
     *
     * @return \AmazonAdvertisingApi\Model\SDTargetingRecommendationsProducts
     */
    public function getProducts()
    {
        return $this->container['products'];
    }

    /**
     * Sets products
     *
     * @param \AmazonAdvertisingApi\Model\SDTargetingRecommendationsProducts $products products
     *
     * @return $this
     */
    public function setProducts($products)
    {
        $this->container['products'] = $products;

        return $this;
    }

    /**
     * Gets type_filter
     *
     * @return \AmazonAdvertisingApi\Model\SDTargetingRecommendationsTypeFilterV32
     */
    public function getTypeFilter()
    {
        return $this->container['type_filter'];
    }

    /**
     * Sets type_filter
     *
     * @param \AmazonAdvertisingApi\Model\SDTargetingRecommendationsTypeFilterV32 $type_filter type_filter
     *
     * @return $this
     */
    public function setTypeFilter($type_filter)
    {
        $this->container['type_filter'] = $type_filter;

        return $this;
    }

    /**
     * Gets themes
     *
     * @return \AmazonAdvertisingApi\Model\SDTargetingRecommendationsThemes
     */
    public function getThemes()
    {
        return $this->container['themes'];
    }

    /**
     * Sets themes
     *
     * @param \AmazonAdvertisingApi\Model\SDTargetingRecommendationsThemes $themes themes
     *
     * @return $this
     */
    public function setThemes($themes)
    {
        $this->container['themes'] = $themes;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
